package com.ssyt.yt1.day9.homework.oop;

import java.util.Scanner;

/**
 * 访问的客户端
 * 
 * @author Administrator
 *
 */
public class Main {

	public static void main(String[] args) {
		// 蔡成
		Student student1 = new Student("菜头");
		// 穆毅怪
		Student student2 = new Student("小怪wu");
		// 光头强
		Student student3 = new Student("自强");
		// 羊羊
		Student student4 = new Student("羊羊");
		// 大飞哥挖鼻屎
		Student student5 = new Student("大飞哥");

		Group group1 = new Group("高富帅", new Student[] { student1, student2 });
		Group group2 = new Group("青铜组", new Student[] { student3, student4 });
		Group group3 = new Group("砖家组", new Student[] { student5 });

		Class clazz = new Class("云图1班", new Group[] { group1, group2, group3 });

		// Q1?
		// clazz.printGroupAndStudentInfo();

		// Q2?
		// group3.printStudenInfo();

		// Q3?
		// 通过run -> configurations配置arguments参数
		// clazz.printStudentInfoByStudentName(args[0]);
		boolean flag = true;
		while (flag) {
			System.out.println("请输入要查询的名字：");
			Scanner scanner = new Scanner(System.in);
			// Scanner.next()不能有空格！
			// System.out.println(scanner.next());
			// System.out.println(scanner.nextLine());
			if (clazz.printStudentInfoByStudentName(scanner.nextLine())) {
				flag = false;
			}
		}
	}
}
